package cn.arikeky.feign;

import cn.arikeky.domain.MoveUser;
import cn.arikeky.fallback.MoveServiceFallbackFactory;
import cn.arikeky.fallback.MoveUserServiceFallbackFactory;
import cn.arikeky.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(contextId="moveUserService",
        value = "service-move",
        fallbackFactory = MoveUserServiceFallbackFactory.class,
        path = "/movieUser")
public interface MoveUserService {
    @RequestMapping(value = "/{userId}/{movieId}",method = RequestMethod.GET)
    JsonResult watch(@PathVariable("userId")Long userId, @PathVariable("movieId")Long movieId);

    @RequestMapping(value="/save",method= RequestMethod.POST)
     JsonResult saveOrUpdate(@RequestBody MoveUser moveUser);
}